<?php

class Generator_Form_Constant extends Zend_Form
{

	public function __construct(Zend_Controller_Action $controller)
	{		
		$elements=array();
		foreach ($controller->view->captions as $key=>$value)
		{
			$pos=strpos($key,"column-description-");
			if($pos===false)
			{
				$column_name=str_replace("column-","",$key);
				$des_key="column-description-".$column_name;
				$elements[]=$this->createElement ( 'text', $key )
				->setLabel ( $column_name )
				->setValue($value->constant_content)
				->setDescription("<br/><textarea name='$des_key'>".$controller->getHelper('common')->getDescription($column_name)."</textarea>")
				;
			}
		}
		
		$this->addElements ( $elements );
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}
